<?php 
	$this->lang->load('userauth', $this->session->userdata('ua_language')); 

	echo '<h2>'.$form_title.'</h2>';
	if (isset($msg)) { echo "<p class=\"error\">$msg</p>"; }

	if ($mode == 'add') { 
?>
	<div id="addGroup">
		<form id="add_group" name="add_group" method="post" action="<?= site_url('admin/usergroups/addGroup');?>">
			<p>
			<label for="grupnomo"><?= $this->lang->line('ua_groupname');?></label> <?=$this->validation->grupnomo_error; ?>
			<input name="grupnomo" type="text" id="grupo" size="30" value="<?=$this->validation->grupnomo;?>" /> 
			</p><p>
			<label for="priskribo">
				<?= $this->lang->line('ua_groupdescription').'&nbsp;('
					.$this->lang->line('ua_255_char_max').')';?></label> <?=$this->validation->priskribo_error; ?><br />
			<textarea name="priskribo" cols="60" rows="3" id="groupdescription"><?=$this->validation->priskribo;?></textarea>
			</p><p>
			<input type="submit" value="<?= $this->lang->line('ua_addgroup');?>" />
			</p>
		</form>
	</div>

<?php } elseif ( $mode == 'edit') { ?>

	<div id="editGroup">
		<form id="add_group" name="add_group" method="post" action="<?= site_url('admin/usergroups/editGroup');?>">
			<input type="hidden" name="grup_id" value="<?= $grup_id;?>" />
			<p>
			<label for="grupnomo"><?= $this->lang->line('ua_groupname');?></label> 
			<input name="grupnomo" type="text" id="grupnomo" size="30" value="<?= ($this->validation->grupnomo_error) ? ($this->validation->grupnomo) : ($groupinfo->grupnomo);?>" /> <?=$this->validation->grupnomo_error; ?>
			</p><p>
			<label for="priskribo">
				<?= $this->lang->line('ua_groupdescription').'&nbsp;('
					.$this->lang->line('ua_255_char_max').')';?></label> <?=$this->validation->priskribo_error; ?><br />
			<textarea name="priskribo" cols="60" rows="3" id="priskribo"><?= ($this->validation->priskribo_error) ? ($this->validation->priskribo) : ($groupinfo->priskribo);?></textarea>
			</p><p>
			<input type="submit" value="<?= $this->lang->line('ua_editgroup');?>" />
			</p>
		</form>
	</div>

<?php } else { echo $this->lang->line('ua_form_mode_error'); } ?>